package com.joy.vo;

import com.joy.model.Course;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CourseVO {

    private Long id;

    private String name;

    private String teacher;

    private Integer classNum;

    public static CourseVO from(Course course) {
        CourseVO courseVO = new CourseVO();
        courseVO.setId(course.getCourseId());
        courseVO.setName(course.getCourseName());
        courseVO.setTeacher(course.getTeacherName());
        courseVO.setClassNum(course.getClassNum());
        return courseVO;
    }
}
